package ex5;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class 代理处理器 implements MethodInterceptor {
    @Override
    public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
        System.out.println("--cglib代理前期准备工作--");
        System.out.println("查找房源.");
        System.out.println("联系卖家.");
        System.out.println("接送服务.\n");

        methodProxy.invokeSuper(proxy,args);

        System.out.println("\n--cglib代理后期跟踪--");
        System.out.println("与卖家沟通价格");
        System.out.println("中介费 1.5%");
        return null;
    }
}
